import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.Map;
import java.util.Set;

public class For {
	
	static boolean print(int i){
		System.out.println(i);
		return true;
	}
	public static void main(String[] args) throws UnsupportedEncodingException {
		int i = 0;
		for (; i < 2&&print(i); i++,System.out.println("i++")) {
			System.out.println("for:"+i);
		}
		System.out.println("last i value:"+i);
		
		
		String s = "01111111";
		int ii = Integer.valueOf(s, 2);
		System.out.println(ii);
		
		s = Integer.toBinaryString(ii);
		System.out.println(s);
		
		String stest="a";
		System.out.println("gbk len:"+stest.getBytes("gbk").length);
		
		System.out.println("utf len:"+stest.getBytes("utf8").length);
		byte[] b = "a".getBytes("Unicode");
		System.out.println("unicode len:"+b.length);
		
		/*Map<String, Charset> map = Charset.availableCharsets();
		Set<String> set = map.keySet();
		
		for (String string : set) {
			System.out.println(string);
		}*/
		
		
		//System.out.println("ascii len:"+stest.getBytes("ascii").length);
		
		//System.out.println("iso8859-1 len:"+stest.getBytes("iso8859-1").length);
		
		System.out.println((byte)0xFF);
	}
}
